package cloud.xlh.my_system.controller;

import cloud.xlh.my_system.common.response.Response;
import cloud.xlh.my_system.pojo.User;
import cloud.xlh.my_system.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;

/**
 * Created with IntelliJ IDEA.
 *
 * @ project name : code-generator
 * @ Author: XuLeHuang
 * @ Date: 2022/5/30 16:56
 * @ Description:
 */
@Controller
@RequestMapping("/login")
public class LoginController {

    @Autowired
    private LoginService loginService;

    @RequestMapping("/toLoginPage")
    public String toLoginPage() {
        return "/login-manage/login";
    }

    @RequestMapping("/doLogin")
    @ResponseBody
    public Response<String> doLogin(@RequestBody HashMap hashMap) {
        return loginService.doLogin(hashMap);
    }
}
